﻿Imports System.Web

Public Class GlobalApp

	Public Shared ReadOnly Property sessionNameMessage As String
		Get
			Return "sessionnamemessage"
		End Get
	End Property

	Public Shared ReadOnly Property sessionNameEditPWD As String
		Get
			Return "editpwd"
		End Get
	End Property

	Public Shared ReadOnly Property sessionNameEdit As String
		Get
			Return "editofficer"
		End Get
	End Property

	Public Shared ReadOnly Property sessionName As String
		Get
			Return "listofficer"
		End Get
	End Property

	Public Shared ReadOnly Property SessionNameProfile As String
		Get
			Return "profile"
		End Get
	End Property

	Public Shared ReadOnly Property SessionNameRegister As String
		Get
			Return "Register"
		End Get
	End Property

	Public Shared ReadOnly Property SessionNameStep As String
		Get
			Return "Step"
		End Get
	End Property

	Public Shared Property DepositMessage As String
		Get
			Try
				Return HttpContext.Current.Session(GlobalApp.sessionNameMessage)
			Catch ex As Exception
				Common.LogError.AddLogException(ex)
				Return Nothing
			End Try
		End Get
		Set(ByVal value As String)
			HttpContext.Current.Session(GlobalApp.sessionNameMessage) = value
		End Set
	End Property

	Public Shared Property DataSourceEditPWD As Entity.UserInfoItem
		Get
			Try
				Return HttpContext.Current.Session(GlobalApp.sessionNameEditPWD)
			Catch ex As Exception
				Common.LogError.AddLogException(ex)
				Return Nothing
			End Try
		End Get
		Set(ByVal value As Entity.UserInfoItem)
			HttpContext.Current.Session(GlobalApp.sessionNameEditPWD) = value
		End Set
	End Property

	Public Shared Property DataSourceEditOfficer As Entity.OfficerInfoItem
		Get
			Try
				Return HttpContext.Current.Session(GlobalApp.sessionNameEdit)
			Catch ex As Exception
				Common.LogError.AddLogException(ex)
				Return Nothing
			End Try
		End Get
		Set(ByVal value As Entity.OfficerInfoItem)
			HttpContext.Current.Session(GlobalApp.sessionNameEdit) = value
		End Set
	End Property

	Public Shared Property CreateAppStep As Common.EnumType.ECreateAppStep
		Get
			Try
				Return HttpContext.Current.Session(GlobalApp.SessionNameStep)
			Catch ex As Exception
				Common.LogError.AddLogException(ex)
				Return Nothing
			End Try
		End Get
		Set(ByVal value As Common.EnumType.ECreateAppStep)
			HttpContext.Current.Session(GlobalApp.SessionNameStep) = value
		End Set
	End Property

	Public Shared Property Authen As Entity.UserInfoItem
		Get
			Try
				Return HttpContext.Current.Session("ahthen")
			Catch ex As Exception
				Common.LogError.AddLogException(ex)
				Return Nothing
			End Try
		End Get
		Set(ByVal value As Entity.UserInfoItem)
			HttpContext.Current.Session("ahthen") = value
		End Set
	End Property

	Public Shared Property RegisterInfo As Entity.OfficerInfoItem
		Get
			Try
				Return HttpContext.Current.Session(GlobalApp.SessionNameRegister)
			Catch ex As Exception
				Common.LogError.AddLogException(ex)
				Return Nothing
			End Try
		End Get
		Set(ByVal value As Entity.OfficerInfoItem)
			HttpContext.Current.Session(GlobalApp.SessionNameRegister) = value
		End Set
	End Property

	Public Shared Sub RemoveProfileInfo()
		HttpContext.Current.Session.Remove(GlobalApp.SessionNameProfile)
	End Sub

	Public Shared Property ProfileInfo As Entity.OfficerInfoItem
		Get
			Try
				Return HttpContext.Current.Session(GlobalApp.SessionNameProfile)
			Catch ex As Exception
				Common.LogError.AddLogException(ex)
				Return Nothing
			End Try
		End Get
		Set(ByVal value As Entity.OfficerInfoItem)
			HttpContext.Current.Session(GlobalApp.SessionNameProfile) = value
		End Set
	End Property

End Class
